syntax = "proto3";

package user;

service UserService {
  rpc CreateUser (CreateUserRequest) returns (UserResponse);
  rpc GetUser (GetUserRequest) returns (UserResponse);
  rpc UpdateUser (UpdateUserRequest) returns (UserResponse);
  rpc DeleteUser (DeleteUserRequest) returns (EmptyResponse);
  rpc ListUsers (EmptyRequest) returns (ListUsersResponse);
}

message User {
  string id = 1;
  string name = 2;
  string email = 3;
}

message CreateUserRequest {
  User user = 1;
}

message GetUserRequest {
  string id = 1;
}

message UpdateUserRequest {
  string id = 1;
  User user = 2;
}

message DeleteUserRequest {
  string id = 1;
}

message UserResponse {
  User user = 1;
}

message ListUsersResponse {
  repeated User users = 1;
}

message EmptyRequest {}

message EmptyResponse {}
